package sch.frog.behavioral.visitor;

public class VisitorDemo {

    public static void main(String[] args){
        IElement elementA = new ConcreteElementA();
        IElement elementB = new ConcreteElementB();

        ObjectStruct os = new ObjectStruct();
        os.add(elementA);
        os.add(elementB);

        os.pushVisitor(new VisitorA());

        ((ConcreteElementB) elementB).methodQ();

        os.pushVisitor(new VisitorB());
        ((ConcreteElementA) elementA).methodK();

    }

}
